using System;
using System.Collections.Generic;
using System.Text;
using MacomberMap.Common.Components;
using System.ComponentModel;
using System.Drawing;
using MacomberMap.Common.Convertors;
using MacomberMap.Common.Internals;
using MacomberMap.Common.Types;

namespace MacomberMap.Loader.User_Interfaces.Network_Map.Editor
{
    /// <summary>
    /// This class provides a UI editor front-end to a substation
    /// </summary>
    public class MM_Editor_Substation : MM_Editor_Element
    {
        #region Variable declarations 
        /// <summary>
        /// The longitude (X) and latitude (Y) of the substation
        /// </summary>
        [Category("Positioning"), Description("The longitude (X) and latitude (Y) of the substation"), TypeConverter(typeof(MM_PointF_Converter))]
        public PointF LatLong
        {
            get { return ((MM_Substation)BaseElement).LatLong; }
            set { ((MM_Substation)BaseElement).LatLong = value; }
        }

        /// <summary>
        /// The county in which the substation resides
        /// </summary>
        [Category("Positioning"), Description("The county in which the substation resides")]
        public MM_Boundary County
        {
            get { return ((MM_Substation)BaseElement).County; }            
        }

        /// <summary>
        /// The long name of the substation
        /// </summary>
        [Category("Declaration"), Description("The long name of the substation")]
        public String LongName
        {
            get { return ((MM_Substation)BaseElement).LongName; }
            set { ((MM_Substation)BaseElement).LongName = value; }
        }
         
        /// <summary>
        /// The KV levels represented in this substation
        /// </summary>
        [Category("Substation Details"), Description("The KV levels represented in this substation"), TypeConverter(typeof(MM_KVLevel_Locator))]
        public List<MM_KVLevel> KVLevels
        {
            get { return ((MM_Substation)BaseElement).KVLevels; }
            set { ((MM_Substation)BaseElement).KVLevels = value; }
        }

        /// <summary>
        /// The element types represented in this substation
        /// </summary>
        [Category("Substation Details"), Description("The element types represented in this substation"), TypeConverter(typeof(MM_ElementType_Locator))]
        public List<MM_Element_Type> ElementTypes
        {
            get { return ((MM_Substation)BaseElement).ElemTypes; }
            set { ((MM_Substation)BaseElement).ElemTypes = value; }
        }


        /// <summary>
        /// Return a list of lines connected to this substation
        /// </summary>
        [Category("Connectivity"), Description("Return a list of lines connected to this substation")]
        public MM_Line[] ConnectedLines
        {
            get
            {
                return ((MM_Substation)BaseElement).ConnectedLines;
            }
        }

        /// <summary>The substation's current X/Y</summary>
        public Point SubXY;

       
        #endregion

        #region Initialization
        /// <summary>
        /// Initialize a new editor for a substation
        /// </summary>
        /// <param name="BaseSubstation">The substation upon which the editor is based</param>
        public MM_Editor_Substation(MM_Substation BaseSubstation)
            : base(BaseSubstation)
        {
        }
        #endregion
    }
}